import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";

let instance = null;
function render() {
  instance = new Vue({
    router,
    store,
    render: (h) => h(App),
  }).$mount("#app");
}
// 如果独立运行
if (!window.__POWERED_BY_QIANKUN__) {
  render();
}
if (window.__POWERED_BY_QIANKUN__) {
  __webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
}
export async function bootstrap() {
  // Vue.config.productionTip = false;
}

export async function mount(props) {
  console.log("mountprops", props);
  render();
}
export async function unmount() {
  // console.log('instance',ref(instance))
  instance.$destroy();
  instance.$el.innerHTML = "";
}
